print("Example script dk_xiee.lua.");

local BingFengChongJI0 = CLASS(Spell)
BingFengChongJI0.name = '凛风冲击'
BingFengChongJI0.target = 'target'

function BingFengChongJI0:canCast(  )
 	return  getBuffRemianTime('player', '冰冻之雾') > 0
end
local AnYingDaJi = CLASS(Spell)
AnYingDaJi.name = '暗影打击'
AnYingDaJi.target = 'target'

function AnYingDaJi:canCast( )
	-- body
	return getDebuffRemainTime('target', '死疽') == 0
end

-------------------------
local LingHuiShouGe = CLASS(Spell)
LingHuiShouGe.name = '灵魂收割'
LingHuiShouGe.target = 'target'

function LingHuiShouGe:canCast( )
	-- body
	return getHpParent( 'target' ) < 0.40
end

----------------------------------
local SiWangHongXi = CLASS(Spell)
SiWangHongXi.name = '死亡虹吸'
SiWangHongXi.target = 'target'
function SiWangHongXi:canCast( )
	return getHpParent( 'player' ) < 0.5 and slowdown
end

function SiWangHongXi:checkDistance(  )
	return true
end

----------------------------------
local LingJieDaJi = CLASS(Spell)
LingJieDaJi.name = '灵界打击'
LingJieDaJi.target = 'target'
function LingJieDaJi:canCast( )
	return getHpParent( 'player' ) < 0.5 and slowdown
end

--------------------------
local BingDongChuMo = CLASS(Spell)
BingDongChuMo.name = '冰冷触摸'
BingDongChuMo.target = 'target'
function BingDongChuMo:canCast( )
	return haveStealableBuff()
end

----------------------------------
local BingShuangDaJi = CLASS(Spell)
BingShuangDaJi.name = '冰霜打击'
BingShuangDaJi.target = 'target'

function BingShuangDaJi:checkDistance(  )
 	return IsSpellInRange('暗影打击', 'target') ~= 0
end

----------------------------------
local BingFengChongJI = CLASS(Spell)
BingFengChongJI.name = '凛风冲击'
BingFengChongJI.target = 'target'

function BingFengChongJI:canCast(  )
 	return IsSpellInRange('暗影打击', 'target') == 0 or getBuffRemianTime('player', '冰冻之雾') > 0
 	-- return true;
end

------------------------------------
local XinLingBingDong = CLASS(Spell)
XinLingBingDong.name = '心灵冰冻'
XinLingBingDong.target = 'target'

------------------------------------
local JiaoXi = CLASS(Spell)
JiaoXi.name = '绞袭'
JiaoXi.target = 'target'

------------------------------------
local SiWangZhiWo = CLASS(Spell)
SiWangZhiWo.name = '死亡之握'
SiWangZhiWo.target = 'target'

------------------------------------
local XianXueLingQi = CLASS(Spell)
XianXueLingQi.name = '鲜血灵气'
function XianXueLingQi:canCast( )
	return GetShapeshiftForm() ~= 1
end


-------------------------------------
local BingShuangLingQi = CLASS(Spell)
BingShuangLingQi.name = '冰霜灵气'
function BingShuangLingQi:canCast( )
	return GetShapeshiftForm() ~= 2
end

local HanBingSuoLian = CLASS(Spell)
HanBingSuoLian.name = '寒冰锁链'
HanBingSuoLian.target = 'target'
function HanBingSuoLian:canCast( )
	local ret = true
	foreachDebuff('target', function( name, debuffType )
		-- print(name, debuffType)
		if name == '寒冰锁链'  then
			ret = false
			return true
		end
	end)
	-- print('ret ', ret)
	return ret
end
hanBingSuoLian = HanBingSuoLian.new()

local BingDK = CLASS(Scheme)

function BingDK:ctor( )
	-- body

	self:addSpell(BingFengChongJI0.new())
	self:addSpell(BingDongChuMo.new())
	self:addSpell(AnYingDaJi.new())
	self:addSpell(SiWangHongXi.new())
	self:addSpell(LingHuiShouGe.new())
	-- self:addSpell(LingJieDaJi.new())
	self:addSpell(Spell.new('湮没', 'target'))
	self:addSpell(BingShuangDaJi.new())
	self:addSpell(BingFengChongJI.new())
	-- self:addSpell(Spell.new('吸血瘟疫'))

	self:addInterruptSpell(XinLingBingDong.new())
	-- self:addInterruptSpell(JiaoXi.new())
	-- self:addInterruptSpell(SiWangZhiWo.new())

	-- self.slowSpell = XianXueLingQi.new()
	-- self.normalSpell = BingShuangLingQi.new()
	self:addToggleSpell(XianXueLingQi.new())
	self:addToggleSpell(BingShuangLingQi.new())
	self:addToggleSpell(Spell.new('绞袭', 'target'))
end

schemeMap[62] = BingDK.new()
--/run print(IsSpellInRange('冰霜打击','target'))
